//package com.atguigu.lease.common.convert;
//
//import com.atguigu.lease.model.enums.FacilityInfoTypeEnum;
//import org.springframework.core.convert.converter.Converter;
//import org.springframework.stereotype.Component;
//import org.springframework.util.StringUtils;
//
////springmvc的  将string参数转为FacilityInfoTypeEnum对象的转换器
//@Component
//public class FacilitiyInfoTypeEnumConverter implements Converter<String, FacilityInfoTypeEnum> {
//    @Override
//    public FacilityInfoTypeEnum convert(String source) {
//        //source表示 接口接收到的参数(1,2)
//        if(StringUtils.hasLength(source)){
//            for (FacilityInfoTypeEnum typeEnum : FacilityInfoTypeEnum.class.getEnumConstants()) {
//                if(typeEnum.getCode().toString().equals(source)){
//                    return typeEnum;
//                }
//            }
//        }
//        return null;
//    }
//}
